import {
  createSelector,
  createFeatureSelector,
  ActionReducerMap
} from "@ngrx/store";
import * as fromMain from "./main.reducer";
import { MainActions } from "../actions";
import * as fromRoot from "@/reducers";

export interface MainState {
  main: fromMain.State;
}

export interface State extends fromRoot.State {
  main: MainState;
}

export const reducers: ActionReducerMap<
  MainState,
  MainActions.MainActionsUnion
> = {
  main: fromMain.reducer
};
// here is deprecated

export const getMainState = createFeatureSelector<State, MainState>("main");

export const symbolLists = createSelector(
  getMainState,
  (state: any) => state.main.selectSymbolResponse.data
);
